package com.yoomiito.app.ui.my.psw;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.yoomiito.app.R;
import com.yoomiito.app.base.BaseActivity;
import com.yoomiito.app.utils.UserInfoConfig;
import com.yoomiito.app.widget.ItemView;

import butterknife.BindView;
import butterknife.OnClick;
import cn.droidlover.xdroidmvp.router.Router;

public class PswManagerActivity extends BaseActivity {
    @BindView(R.id.tv_center)
    TextView titleTv;
    @BindView(R.id.set_pay_psw)
    ItemView mItemView;
    @Override
    public int getLayoutId() {
        return R.layout.act_psw_manager;
    }

    @Override
    public Object newP() {
        return null;
    }

    public static void start(Context context){
        Intent intent = new Intent(context,PswManagerActivity.class);
        context.startActivity(intent);
    }

    @Override
    public void initData(Bundle savedInstanceState) {
        titleTv.setVisibility(View.VISIBLE);
        titleTv.setText("支付验证管理");
        if (UserInfoConfig.havePayPsw()){
            mItemView.setTitleText("修改支付密码");
        }else {
            mItemView.setTitleText("设置支付密码");
        }
    }

    @OnClick({R.id.iv_back_left,R.id.set_pay_psw})
    public void onClick(View view){
        switch (view.getId()){
            case R.id.iv_back_left:
                finish();
                break;
            case R.id.set_pay_psw:
                SetPayPswActivity.start(this);
                break;
        }
    }
}
